package com.gzg.userservice.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

@FeignClient(value = "permission-service")
public interface PermissionClient {
    //绑定默认角色,对于权限微服务而言,这是一个新增操作
     @PutMapping("/permission/{userId}")
     void bindDefaultRole(@PathVariable("userId") Long userId);

     @GetMapping("/permission/{userId}")
     String getUserRoleCode(@PathVariable("userId") Long userId);

     @GetMapping("/permission/normal")
     List<Long> getNormalUserIds();

     @GetMapping("/permission/roleId/{userId}")
     int getUserRoleId(@PathVariable("userId") Long userId);
}
